home *** CD-ROM | disk | FTP | other *** search
- Path: news.ov.com!news
- From: glenn@ov.com (Fletcher.Glenn@ov.com)
- Newsgroups: comp.lang.c
- Subject: Re: preprocessing question
- Date: 8 Mar 1996 01:05:41 GMT
- Organization: OpenVision
- Message-ID: <4ho155$9gi@spanky.pls.ov.com>
- References: <313b9e9f.480978@NEWS.CLOUD9.NET>
- Reply-To: glenn@ov.com
- NNTP-Posting-Host: foghorn.pls.ov.com
-
- In article 480978@NEWS.CLOUD9.NET, jalvo@cloud9.net (John G. Alvord) writes:
- >I have a couple compilers argument about the following problem:
- >
- > #define XXX (1)
- > #include <stdio.h>
- > int main(void)
- > {
- > #if XXX
- > printf("Hello World!");
- > #endif
- > return 0;
- > }
- >
- >most compilers I have tried preprocess the #if resulting in "#if (1)" and then
- >follow that instruction to generate the printf() call.
- >
- >One compiler (SAS/C 5.50 cross compiler on AIX for MVS) complains that the #if
- >line is an illegal constant. A close reading of the ANSI C standard document
- >reveals a clause that seems to imply (my reading) that a pre-processed series
- >of tokens that appear to be a preprocessing statement will be ignored. A
- >coworker who is more experienced then me feels that the #if does not fall
- >under that clause and the #if will be evaluated. His reasoning is that the
- >preprocessed series of tokens is just a part of a preprocessing statement.
- >
- >If someone can shed some light on this, he would make me very happy.
- >
- >Thanks!
- >
- >John Alvord
-
-
- I know of at least three separate compilers that require that the
- '#' character be in the first column of the source line for
- preprocessor directives.
-
- Fletcher.Glenn@ov.com
-
-
-